package gov.nasa.anml.utility;


// The type ascribed to illegal operations, i.e., 'null' or 'void'.
// Used for the l-values of expressions, for example.
public class SimpleVoid implements SimpleObject<SimpleVoid> {

	public static final SimpleVoid instance = new SimpleVoid();

	private SimpleVoid() {
	}

	public int hashCode() {
		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		return false;
	}
	
	public boolean equals(SimpleVoid obj) {
		if (this == obj)
			return true;
		return false;
	}
	
	public SimpleVoid clone() {
		return instance;
	}

	public int compareTo(SimpleVoid o) {
		if (this == null)
			return 1;
		if (o == null)
			return -1;
		return 0;
	}

	public int compareTo(SimpleObject<SimpleVoid> o) {
		SimpleVoid i = (SimpleVoid) o;
		if (this == null)
			return 1;
		if (o == null)
			return -1;
		return 0;
	}

	public String toString() {
		return "void";
	}

	public void assign(SimpleVoid c) {
		assert false : "Assigning to a void type shouldn't happen";
	}
	
	public SimpleVoid value() {
		return this;
	}
}
